package com.cskaoyan.javase.oop2._1extends._7initialization._3exercise;

/**
 *
 *
 * @since 15:09
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo2 {
    public static void main(String[] args) {
        Son s = new Son();
        System.out.println(s.getA());
    }
}

class Grandfather {
     int a = 10;

    public int getA() {
        return a;
    }
}

class Father extends Grandfather {
    int a = 100;

    public int getA() {
        return a;
    }
}

class Son extends Father {
    int a = 1000;

    public int getA() {
        return a;
    }

    public void test() {
        System.out.println(super.a);
    }
}